﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SharedGenomics.Workbench.Core;
using SharedGenomics.Annotations;

namespace SharedGenomics.Workbench.Presenters
{
    public class NcbiSummaryAnnotationMenuProvider : AnnotationMenuProvider
    {
        public NcbiSummaryAnnotationMenuProvider(CommandFactory commandFactory, IMenuFactory menuFactory)
            : base(commandFactory, menuFactory)
        {
        }

        public override IMenuItem CreateMenu(IAnnotation annotation)
        {
            NcbiAnnotation ncbiAnnotation = (NcbiAnnotation)annotation;
            IMenuItem menuItem = this.MenuFactory.CreateContextMenuItem();
            menuItem.DisplayText = "Ncbi summary";
            menuItem.Command = this.CommandFactory.CreateOpenPresenterAnnotationCommand<NcbiSummaryPresenter>(FormDisplayMode.NonModalDialog, p => p.Annotation = ncbiAnnotation, ncbiAnnotation);

            return menuItem;
        }

        public override Type AnnotationType
        {
            get { return typeof(NcbiAnnotation); }
        }
    }
}
